#include<iostream>
#include<signal.h>

using namespace std;

volatile int flag=0;

void handler(int signo)
{
    cout<<"i get signo: "<<signo<<endl;
    flag=1;
}
int main()
{
    signal(2,handler);

    while(!flag);

    cout<<"process quit"<<endl;

    return 0;
}